import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport from 'vite-plugin-style-import'
const path = require('path')


export default defineConfig({
    plugins: [
        vue(),
        styleImport({
            libs: [
                {
                    libraryName: 'element-plus',
                    esModule: true,
                    ensureStyleFile: true,
                    resolveStyle: (name) => {
                        return `element-plus/lib/theme-chalk/${name}.css`;
                    },
                    resolveComponent: (name) => {
                        return `element-plus/lib/${name}`;
                    },
                },
                {
                    libraryName: 'vant',
                    esModule: true,
                    resolveStyle: (name) => `vant/es/${name}/style`,
                },
            ]
        })
    ],
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "./src/assets/js"), 
            "@img": path.resolve(__dirname, "./src/assets/img"), 
            "@css": path.resolve(__dirname, "./src/assets/css"), 
            "@h": path.resolve(__dirname, "./src/views/homeChild"), 
            "@c": path.resolve(__dirname, "./src/components"), 
            
        },
    }
   
})
